package com.ganbo.bigevent.entity;


import com.ganbo.bigevent.annotation.State;
import com.ganbo.bigevent.entity.pojo.BaseEntity;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

@Data
public class Article extends BaseEntity {

    private Integer id;//主键ID

    @NotEmpty(message = "文章标题不符合规范")
    @Pattern(regexp = "^\\S{1,10}$")
    private String title;//文章标题

    @NotEmpty(message = "文章内容不符合规范")
    private String content;//文章内容

    @NotEmpty(message = "文章封面图像不符合规范")
    @NotEmpty
    @URL
    private String coverImg;//封面图像

    @State
    private String state;//发布状态 已发布|草稿
    @NotNull
    private Integer categoryId;//文章分类id
    private Integer createUser;//创建人ID
}
